﻿using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model.DTO;
using Model;

namespace API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ArreayController : ControllerBase
    {
        public ArreayController(ArrerIBLL Db)
        {
            this.Db = Db;
        }

        public ArrerIBLL Db { get; }
        [HttpPost]
        public Task<int> Add(Fanghao a)
        {
            return Db.Add(a);
        }
        [HttpGet]
        public async Task<int> Delete(int id)
        {
            return await Db.Delete(id);
        }
        [HttpGet]
        public Fanghao GetArray(int id)
        {
            return Db.GetArray(id);


        }
        [HttpGet]
        public ArreayKKDTO Show(int pageIndex, int pageSize)
        {
            return Db.Show(pageIndex, pageSize);
        }
        [HttpGet]
        public Task<int> UpdateState(int a)
        {
            return Db.UpdateState(a);
        }
    }
}
